{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Times New Roman;}{\f4\fmodern\fprq1\fcharset0 Courier New;}{\f5\fswiss\fprq2\fcharset128 Microsoft Sans Serif;}{\f6\fswiss\fprq2\fcharset0 Arial Unicode MS;}{\f7\fnil\fprq2\fcharset0 MS Mincho;}{\f8\fnil\fprq0\fcharset0 Tahoma;}}
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
{\stylesheet{\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\snext1 Normal;}
{\s2\sb240\sa120\keepn\rtlch\af2\afs28\lang255\ltrch\dbch\af7\langfe255\hich\f2\fs28\lang1033\loch\f2\fs28\lang1033\sbasedon1\snext3 Heading;}
{\s3\sa120\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext3 Body Text;}
{\s4\sa120\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon3\snext4 List;}
{\s5\sb120\sa120\rtlch\af8\afs24\lang255\ai\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext5 caption;}
{\s6\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext6 Index;}
{\s7\sb120\sa120\rtlch\afs24\lang255\ai\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext7 caption;}
{\s8\rtlch\af4\afs20\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs20\lang1033\loch\f4\fs20\lang1033\sbasedon1\snext8 Preformatted Text;}
}
{\info{\creatim\yr2011\mo7\dy19\hr6\min24}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern3000}}\deftab709
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}}
{\*\pgdscno0}\paperh15840\paperw12240\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pard\plain \ltrpar\s1\ql\rtlch\af5\afs20\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 using Tesla.Bounding;}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 using Tesla.Content;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 using Tesla.Math;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 using Tesla.Scene;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 using Tesla.Scene.Extension;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 using Tesla.Scene.Shape;}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 namespace TeslaSamples.Pipeline \{}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 [AppDescription("DXS Model Loading", PlatformCapabilities.Direct3D10 | PlatformCapabilities.XNA4, "DxsModelLoadingImage", "DxsModelLoadingDesc", "DxsModelLoadingSource")]}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 public class DxsModelLoading : BasicApp \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 protected override void LoadContent() \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //When calling ContentManager.Load<T>(), an optional loader parameter can be passed that tells the content importer}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //how to process the content. Model loaders take ModelLoaderParameters and image loaders take ImageLoaderParameters. They}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //can be re-used.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //In this case, we have to tell the model loader that we want to swap the winding order of polygons so we do not get}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //incorrect rendering. Other options include the angle at which to rotate the model about the XYZ axes, how normals should}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //be generated (if any), if a tangent basis should be generated, where to find textures, or overload material creation by}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //supplying a material to load and use as a template.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 ModelLoaderParameters mlp = new ModelLoaderParameters();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 mlp.SwapWindingOrder = true;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 mlp.PreferLitMaterials = true;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //In BasicApp, we registered a DXSModelLoader to the content manager, if we didn't this will throw}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //an exception that we do not have a means to handle the requested content. Loaders are designated by}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //both the runtime type and the content file extension.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //Notice with loading this model, we use Spatial rather than Mesh, because a model may be in fact a}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //scene graph with multiple parts. We can either have a Node or Mesh returned. In this case,}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //we should have a mesh returned since the model is a single mesh in the file. If the model}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //used two different materials, it would have to be split up into two different meshes}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //and then attached to a Node that would be returned, for example.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 Spatial model = ContentManager.Load<Spatial>("Models//station.dxs", mlp);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 model.AddController(new RotateController(Vector3.Up, 5));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 model.SetModelBound(new BoundingBox());}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 RootNode.AddChild(model);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 Box sky = new Box("Space", Vector3.Zero, 100, 100, 100);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 sky.SceneHints.RenderBucketType = RenderBucketType.PreBucket;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 sky.Material = ContentManager.Load<Material>("Materials//SpaceSkybox.tem");}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 RootNode.AddChild(sky);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 \}}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 \}}
\par }